#ifndef __PROC_H
#define __PROC_H

#include "mm.h"
#include "typedef.h"

/*different possible states for a process to be in*/
#define 	BLOCKED	        	0
#define		RUNNABLE		1
#define		ZOMBIE	        	2

/*initial running time a process gets before it is swapped out*/
#define		INITIAL_QUANTUM	        10

/*process types*/
#define 		NORMAL			0     /*ie interruptible*/
#define		        NON_INTERRUPTABLE	1

/*stores register context at the state they are in before process is swapped out*/
typedef struct reg_context {
  u32 ebx;
  u32 esi;
  u32 edi;
  u32 esp;
  u32 ebp;
  u32 eflags;
  u32 eip;
  u32 eax;
  u32 ecx;
  u32 edx;
} proc_regs;

typedef struct proc_struct {
  proc_regs regs;
  pde_t* page_dir;
  u32 id;		
  u32 state;	
  u32 quantum;
  struct proc_struct* next;
  struct proc_struct* prev;
  struct proc_struct* parent;
} proc_t;

void init_proc();
void task_switch(proc_t);
u32 get_pid();
u32 fork();
void proc_switch(proc_t*);
void schedule();

#endif
